<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateGroundPersonalInfoBusinTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('ground_personal_info_busin', function (Blueprint $table) {
            $table->increments('id');
            $table->string('city_id',5)->comment('城市id');
            $table->string('salesman_id',11)->comment('个人地推id');
            $table->string('salesman_mobile',20)->comment('个人地推手机号');
            $table->string('salesman_name',100)->comment('个人地推姓名');
            $table->string('salesman_qr_code',100)->comment('个人地推二维码');
            $table->integer('valid_register_amount')->default(0)->comment('有效注册用户数量');
            $table->integer('register_amount')->default(0)->comment('注册用户数量');
            $table->integer('valid_recharge_amount')->default(0)->comment('有效充值数量');
            $table->string('valid_order_amount')->default(0)->comment('有效订单数量');
            $table->decimal('ground_register_fee',16,2)->default(0.00)->comment('地推注册收入');
            $table->decimal('ground_other_fee',16,2)->default(0.00)->comment('地推其他收入');
            $table->decimal('ground_total_fee',16,2)->default(0.00)->comment('地推总体收入（元）');
            $table->string('ground_remark',500)->comment('地推备注');
            $table->string('status',4)->default(1)->comment('地推状态');
            $table->decimal('register_fee',16,2)->comment('注册收入');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('ground_personal_info_busin');
    }
}
